package com.dz.risk.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.Assert;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;


/**
 * @author 查询类
 * @className QueryParams
 * @description TODO
 * @String 2021/2/5 10:06
 */
@ApiModel(value = "查询入参")
@Data
public class QueryParams {

    /**
     * 风险类容
     */
    @ApiModelProperty(value = "模糊查询字段")
    private String searchName;

    /**
     * 当前页
     */
    @ApiModelProperty(value = "当前页")
    private Integer pageNum;
    /**
     * 分页长度
     */
    @ApiModelProperty(value = "分页长度")
    private Integer pageSize;

    @ApiModelProperty(value = "开始时间", example = "2021-01-01 HH:mm:ss")
    private String startTime;

    @ApiModelProperty(value = "结束时间", example = "2021-09-01 HH:mm:ss")
    private String endTime;

    @ApiModelProperty(value="单元格所在表名")
    private String tableName;

    @ApiModelProperty(value="动作类型(新增、修改.....)")
    private String actionType;

    @ApiModelProperty(value="日期")
    private String initDate;

    @ApiModelProperty(value="版本日期")
    private Long version;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createdUser;

    @ApiModelProperty(value = "债券代码")
    private String bondCode;

    @ApiModelProperty(value = "债券名称")
    private String bondName;

    @ApiModelProperty(value = "证券代码")
    private String stockCode;

    @ApiModelProperty(value = "证券名称")
    private String paperTitles;

    @ApiModelProperty(value = "证券简称")
    private String abbreviationOfSecurities;

    @ApiModelProperty(value = "证券代码")
    private Integer bondType;

    /**
     * 此开始时间默认为空
     */
    @ApiModelProperty(value = "开始时间")
    private Integer beginDate;

    /**
     * 此结束时间默认为空
     */
    @ApiModelProperty(value = "结束时间")
    private Integer endDate;

    @ApiModelProperty(value = "报表编号")
    private String serialNumber;

    @ApiModelProperty(value = "公式编号")
    private String indexId;

    @ApiModelProperty(value = "公式编号")
    private String indexNumber;

    @ApiModelProperty(value = "公式编号")
    private String indexName;



    public Integer getPageNum() {
        return null == pageNum ? 0 : pageNum;
    }

    public Integer getPageSize() {
        return null == pageSize ? 10 : pageSize;
    }


    public String getStartTime() {
        return null == startTime ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) : startTime;
    }

    public String getEndTime() {
        return null == endTime ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) : endTime;
    }

}
